package io.github.talelin.latticy.feign;

import io.github.talelin.latticy.vo.FindResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @ClassName：WmsCategoryFeignClient
 * @Author: ljj
 * @Date: 2022/6/10 14:19
 */
@FeignClient(value = "wms-server")
public interface WmsCategoryFeignClient {

    /**
     * 获取品类
     * @return
     */
    @GetMapping("/v1/category/getCategoryTree")
    FindResultVO getCategory();


    /**
     * 根据id查询品类
     * @param id
     * @return
     */
    @GetMapping("/v1/category/{id}")
    FindResultVO getCategoryById(@PathVariable Integer id);

    /**
     * 根据ids查询品类
     * @param ids
     * @return
     */
    @PostMapping("/v1/category/getByIds")
    FindResultVO getByIds(@RequestBody List<Integer> ids);


    /**
     * 查询当前id的所有父级id
     * @param id
     * @return
     */
    @GetMapping("/v1/category/findParentId/{id}")
    FindResultVO findParentId(@PathVariable Integer id);
}
